/**
 *<p>Copyright: CHINA NATIONAL SOFTWARE & SERVICE CO.,LTD.</p>
 */
package com.cssnb.wwxt.xxtx;

import java.util.List;
import java.util.Map;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.cssnb.wwxt.xxtx.service.IMsgService;


/**
 * @Company: 中国软件与技术服务股份有限公司宁波子公司
 * @Project: 宁波市国税-外维系统
 * @Module ID: 
 * @Description: 
 * @JDK version used: JDK1.6
 * @Author: 卜繁晟
 * @Email: 5545795@qq.com | bufsh@css.com.cn
 * @Created Date: 2013-6-14 上午12:40:55
 */
@SuppressWarnings("rawtypes")
public class ClientSpringRmi {
	public static void main(String[] args){
		ApplicationContext ctx = new ClassPathXmlApplicationContext("rmi_client_context.xml");
		IMsgService msgService = (IMsgService) ctx.getBean("msgService");
		System.out.println(msgService.say("asd"));
		List msgList = msgService.getMessageList("bfs_receiver", 0);
		if(msgList.size() > 0){
			for(int i = 0; i < msgList.size(); i++){
				System.out.println(((Map)msgList.get(0)).get("URL"));
			}
		}else{
			int result = msgService.addMessage("test_title", "test_content", "http://www.baidu.com", "bfs_sender", "bfs_receiver", "", 0);
			if(result > 0){
				System.out.println("添加成功！");
			}
		}
	}
}